<?php 
defined( '_JEXEC' ) or die( 'Restricted access' );

$cparams = JComponentHelper::getParams ('com_media');

$lang =& JFactory::getLanguage();
//$template_dir = $this->baseurl.'/templates/mwc_careitec/assets/';
$template_dir = '/templates/mwc_careitec/assets/';
jimport('mylibs.function');
jimport('mylibs.globalModel');
$globalModel = new globalModel();
?>
<script type="text/javascript" src="<?php echo $template_dir; ?>scripts/easyTooltip.js"></script>
<script type="text/javascript">
    $(document).ready(function(){	
        $("a").easyTooltip();
        $("a#link1").easyTooltip({
            tooltipId: "easyTooltip1",
            content: '&nbsp;'
        });
    });
</script>
<script type="text/javascript">
    $(document).ready(function(){	
        $("a").easyTooltip();
        $("a#link2").easyTooltip({
            tooltipId: "easyTooltip2",
            content: '&nbsp;'
        });
    });
</script>
<script type="text/javascript">
    $(document).ready(function(){	
        $("a").easyTooltip();
        $("a#link3").easyTooltip({
            tooltipId: "easyTooltip3",
            content: '&nbsp;'
        });
    });
</script>

<?php 
$menu_id = JRequest::getVar('Itemid', 0, 'get');
$cat_id = JRequest::getVar('category_id', 0, 'get');
$layout = JRequest::getVar('layout', 0, 'get');
$emulate = JRequest::getVar('emulate', 0, 'get'); 
$current_id = JRequest::getVar('id', 0, 'get');  
$success = JRequest::getVar('success', 0, 'get');

$menus = &JSite::getMenu();                                             
$menu  = $menus->getActive();    
$ignore = $menu->query['id'];   
?>

<div id="main" class="p15t">
    <div class="w214 float_left">
        <!-- Menu -->
        <div class="w214 left_menu m10b">
            <div class="left_menu">
                <ul class="parent_menu">    
                    <li class="curr_left_menu">
                        <a href="javascript:void(0);"><?php echo $menu->name; ?></a> 
                        <ul class="child_menu">                                
                            <?php 
                            $layout = $layout ? '&layout=' . $layout : '';                            
                            $sub_menu = $globalModel->getChildrenMenu($menu_id, 0); 
                            foreach($sub_menu as $value ){ 
                                //$selected = $current_id == $value['id'] ? ' class="active"'   : '';                                
                                $current  = $current_id == $value['id'] ? ' class="curr_sub"' : '';
                                $link = $value['link']. '&Itemid=' . $menu_id . '&id=' . $value['id'];
                                ?>    
                                <li<?php //echo $selected; ?>>
                                    <a <?php echo $current; ?> href="<?php echo $link; ?>" ><?php echo $value['name'];?></a>
                                </li>                  
                            <?php } ?> 
                        </ul>
                    </li> 
                </ul>
            </div>
            <div class="left_menu_bot"></div>
        </div>
        
        <!-- Book -->
        <div class="w214 po m10b"> 
            <?php $link = $globalModel->getLeftColumnBookLink(); ?>             
            <a href="<?php echo $link; ?>"><img src="<?php echo $template_dir; ?>images/book_banner.png" alt="" /></a>                        
        </div>
        
        <!-- News -->
        <div class="w214">
            <div class="ads_sub_top"></div>
            <div class="ads_sub_mid">
                <div class="w186 mc p10t p10b">
                    <?php                 
                    // Intel Inside   
                    $arr_data2 = $globalModel->getLeftColumnArticle();
                    foreach($arr_data2 as $key => $value){    
                        $text = strip_tags($value['introtext']);
                        $text = strlen($text) > 100 ? mb_substr($text, 0, 100, 'UTF-8') : $text;
                        $link = $globalModel->getLeftColumnArticleLink($value['id']);
                        ?> 
                        <?php if(1==0){ ?>
                        <a href="<?php echo $link; ?>"><img src="<?php echo $template_dir; ?>images/banner_ads_sub.jpg" alt="<?php echo $value['title'];?>" /></a>
                        <?php } ?>
                        <a href="<?php echo $link; ?>"><img src="<?php echo $value['article_image']; ?>" alt="<?php echo $value['title'];?>" /></a>                             
                        <p class="p5t"><?php echo $text; ?>...<a href="<?php echo $link; ?>"><?php echo JText::_('READ_MORE'); ?></a></p>                            
                    <?php } ?> 
                </div>
            </div>
            <div class="ads_sub_bot"></div>
        </div>
    </div>
    
    <div class="w708 bg_left_col2 float_right p22l">
        <div class="w708 bg_tt_sub1">
            <h2 class="p5t float_left"><?php echo !$emulate ? $menu->name : $this->escape($this->contact->name); ?></h2>
            <p class="float_right p5t" style="display:none"><a href="#"><img src="<?php echo $template_dir; ?>images/tilbage_icon.png" alt="" /> Tilbage</a></p>
            <br style="clear:both" />
        </div>
        <div class="w708">
            <?php 
            if($success) {
                echo $this->loadTemplate('success');
            }
            else{
            ?>
                <div class="w708 bg_shadow_bot1">
                    <div class="float_left w347">
                        <p class="p10t"><?php echo JText::_('MESSAGE_STATUS1'); ?></p><br/>
                        <p><?php echo JText::_('MESSAGE_STATUS2'); ?></p><br/>
                        <p><?php echo JText::_('MESSAGE_STATUS3'); ?></p><br/>
                        <p><?php echo JText::_('MESSAGE_STATUS4'); ?> <span class="organ_text fz15"><a href="<?php $this->baseurl; ?>">www.careitec.dk</a></span></p>
                        <p class="p5t"><?php echo JText::_('MESSAGE_STATUS5'); ?> <span class="organ_text fz15">70 10 11 12</span></p>
                    </div>
                    <div class="w315 float_right p10t">
                        <img src="<?php echo $template_dir; ?>images/logo_contact.png" alt="" />
                        <div class="contact_sub p10t">
                            <p>Langballe 2<br/>
                                8700 Horsens<br/>
                                Fax. 75 64 77 66</p>
                        </div>
                        <div class="contact_sub p10t">
                            <p>Islevdalvej 148<br/>
                                2610 Rødovre</p>
                        </div>
                        <div class="contact_sub p10t" style="border-bottom:0px;">
                            <p>Vandmanden 32<br/>
                                9200 Ålborg</p>
                        </div>
                    </div>

                    <div class="cb"></div>

                </div>
                <div class="w708 m50b">
                    <div class="float_left w347">
                        <?php echo $this->loadTemplate('form'); ?> 
                    </div>
                    
                    <div class="w315 float_right">
                        <div class="map_danish po">
                            <a href="#" id="link3"><img src="<?php echo $template_dir; ?>images/space.png" alt="" style="position:absolute; top:50px; left:30px;"/></a>
                            <a href="#" id="link1"><img src="<?php echo $template_dir; ?>images/space.png" alt="" style="position:absolute; top:152px; left:30px;"/></a>
                            <a href="#" id="link2"> <img src="<?php echo $template_dir; ?>images/space.png" alt="" style="position:absolute; top:170px; left:160px;"/></a>
                        </div>
                    </div>
                    <div class="cb"></div>    
                </div> 
            <?php } ?>
        </div> 
    </div>
    <div class="cb"></div>
</div>

<div id="footer" class="bg_foot_sub">
<!-- 
    <embed src="<?php //echo $this->baseurl; ?>/media/music/funktionstast_logolyd_2sek.mp3" autostart="true" loop="false" hidden="true" volume="10"> </embed>
-->    
    <div class="w950 mc p15t p15b">
        <p class="float_left">Copyright © 2010 <a href="<?php echo $this->baseurl; ?>">CAREITEC.DK</a>. All rights reserved.</p>
        <p class="float_right">Design by <a href="http://www.mywebcreations.dk/" target="_blank">My Web Creations</a></p>
        <br style="clear:both" />
    </div>
</div>
</div>
</div>
